home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6660 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: dispatch.news.demon.net!demon!thesett.demon.co.uk
  2. From: Andy@thesett.demon.co.uk (Andy Goodwin)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: IDE HardDrive Serial Number??
  5. Date: Thu, 15 Feb 1996 22:32:50 GMT
  6. Message-ID: <3123b1ac.622770@news.demon.co.uk>
  7. References: <3102f286.115207123@news.onramp.net>
  8. NNTP-Posting-Host: thesett.demon.co.uk
  9. X-NNTP-Posting-Host: thesett.demon.co.uk
  10. X-Newsreader: Forte Agent .99c/16.141
  11.  
  12. On Mon, 22 Jan 1996 02:13:36 GMT, redbaron@onramp.net (Ronnie Moller,
  13. Jr.) wrote:
  14.  
  15. >I am trying to get the information off an IDE HardDrive, for example
  16. >the Serial number, and the manufactures model number.  If some one
  17. >could point me in the write direction, I would appreciate it.
  18. >
  19. >Ronnie
  20.  
  21. The following assembler will get the IDE information
  22.  
  23.        MOV  AH,0D     ; Code will load at 0100h
  24.        MOV  DL,80  
  25.        INT  13        ;  reset hard disk system
  26.        MOV  AX,0000   ;  issue specify drive 0
  27.        MOV  DX,0F6   ;  command to SDH port
  28.        OUT  DX,AL
  29.        MOV  AL,EC     ;  issue identify drive
  30.        MOV  DX,01F7   ;  command to
  31.        OUT  DX,AL     ;  command port
  32.  
  33.        ; Wait a second here
  34.        NOP            ;
  35.        NOP
  36.        MOV  AX,0000   ; issue specify drive 0
  37.        MOV  DX,0F6   ; command to SDH port
  38.        OUT  DX,AL
  39.        MOV  AX,00E4   ; issue read sector buffer
  40.        OUT  DX,AL     ; command
  41.  
  42.       ; wait a second here
  43.        NOP
  44.        NOP            ;
  45.        CLD
  46.        MOV  AX,CS     ;  set up ES:DI to point to
  47.        MOV  ES,AX     ;  current code segment and
  48.        MOV  DI,0200   ;  offset 0200h for data
  49.        MOV  CX,0100   ;  loop counter (100h
  50.        MOV  DX,01F0   ;  set up data port value
  51.                       ;  address 0130h
  52.  
  53.        IN AX,DX ; read word-wide port
  54.        IN AX,DX       ; read word-wide port
  55.        STOSW          ; store in data area at
  56.        LOOP 0130      ; loop for all 100h words
  57.       
  58.        ; wait a second
  59.  
  60.       NOP
  61.        NOP
  62.        MOV AX,0D00    ; reset disk system
  63.        MOV DX,0080
  64.        INT 13
  65.  
  66.        ; wait a second
  67.  
  68.